package com.ruoyi.merchant.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.merchant.domain.AutoAcceptLog;
import com.ruoyi.merchant.service.IAutoAcceptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 自动接单日志Controller
 */
@RestController
@RequestMapping("/merchant/auto-accept")
public class AutoAcceptController extends BaseController {

    @Autowired
    private IAutoAcceptService autoAcceptService;

    /**
     * 查询自动接单日志
     */
    @GetMapping("/logs")
    public AjaxResult logs(
            @RequestParam(required = false) String startTime,
            @RequestParam(required = false) String endTime) {
        List<AutoAcceptLog> logs = autoAcceptService.selectLogList(startTime, endTime);
        return success(logs);
    }
}
